asterisk
Type
operator
Summary
Multiplies two numbers or arrays containing numbers.
Syntax
<number1> * <number2>
Description
Use the ***** (times) operator to multiply two numbers.
When used in complex arithmetic statements, operators like ***** follows standard rules of precedence.
To multiply the contents of a container by a number, use the multiply command instead.
If either number1 or number2 is an array, each of the array elements must be a number. If an array is multiplied by a number, each element is multiplied by the number. If an array is multiplied by an array, both arrays must have the same number of elements and the same dimension, and each element in one array is multiplied by the corresponding element of the other array.
If an element of one array is empty, the ***** operator treats its contents as zero.
If a math operation on finite inputs produces a non-finite output, an execution error is thrown. See math operations for more information.
Parameters
Name | Type | Description |
---|---|---|
number1 | A number or an expression that evaluates to a number, or an array containing numbers. | |
number2 | A number or an expression that evaluates to a number, or an array containing numbers. |
Examples
local thisNumber
get 3 * 5 -- evaluates to 15
put thisNumber * it into field "Result"
local commonFactor, tempVariable
put (3 + commonFactor) * 4 into tempVariable
local tArray, tProductArray
put 1 into tArray[1]
put 2 into tArray[2]
put tArray * 10 into tProductArray
Related
command: multiply
glossary: operator, array, command, element, precedence, math operation
operator: slash, left-round-bracketright-round-bracket
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
web
Platforms
desktop
server
mobile